<div class="row">
    <div class="col-xs-12">
        <div class="table-responsive">
            <table id="function-table" class="table table-bordered table-hover">
                <thead>
                <tr>
                    <th class="col-sm-1">序号</th>
                    <th class="col-sm-2">功能名称</th>
                    <th class="col-sm-1">菜单显示</th>
                    <th class="col-sm-1">链接地址</th>
                    <th class="col-sm-1">隶属</th>
                    <th class="col-sm-1">状态</th>
                    <th class="col-sm-1">排序</th>
                    <th class="col-sm-3">
                        <a class="blue" title="添加功能" href="/{{adminPath}}/{{$.curController}}/add">
                            <i class="glyphicon glyphicon-plus bigger-130"></i>
                        </a>
                    </th>
                </tr>
                </thead>

                <tbody>
                {{range $k, $v := .list}}
                <tr>
                    <td>{{.Info.Id}}</td>
                    <td>
                        <i class="{{.Info.Icon}}"></i>
                        {{.Info.Name}}--—
                        <a data-toggle="collapse" title="子菜单" data-parent="#function-table" href="#function-{{.Info.Id}}">
                            <i class="glyphicon glyphicon-plus"></i>
                        </a>
                    </th>

                    <td>
                        {{if eq 1 .Info.IsMenu}}
                            <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/setmenu?id={{.Info.Id}}')">
						      <span title="点击取消菜单显示" class="badge badge-warning">是</span>
                            </a>
                        {{else}} 
                            <a class="blue" href="javascript:req('/{{adminPath}}{{$.curController}}/setmenu?id={{.Info.Id}}')">
                                <span class="badge" title="点击设置菜单显示">否</span>
                            </a>
                        {{end}}
                    </td>

                    <td>无</td>
                    <td>根</td>
                    <td>
                        {{if eq 1 .Info.Status}}
                            <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/lock?id={{.Info.Id}}')">
                                <span title="点击锁定" class="badge badge-warning">正常</span>
                            </a>
                        {{else}}
                            <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/lock?id={{.Info.Id}}')">
                                <span title="点击解锁" class="badge">锁定</span>
                            </a> 
                        {{end}}
                    </td>

                    <th>{{.Info.Sort}}</th>

                    <td>
                        <div class="action-buttons">
                        <a class="blue" title="菜单编辑" href="/{{adminPath}}/{{$.curController}}/add?id={{.Info.Id}}">
                            <i class="fa fa-pencil bigger-130"></i>
                        </a>

                        {{if eq .ListCount 0}}
                            <a class="blue" title="删除" href="javascript:req('/{{adminPath}}/{{$.curController}}/del?id={{$v.Info.Id}}')">
                            <i class="fa fa-trash-o bigger-130"></i></a>
                        {{end}}
                       
                        <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/sort?type=up&id={{$v.Info.Id}}')">
                            <i class="ace-icon glyphicon glyphicon-upload" title="排序上升"></i>
                        </a>

                        <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/sort?type=down&id={{$v.Info.Id}}')">
                            <i class="ace-icon glyphicon glyphicon-download" title="排序下降"></i>
                        </a>

                        </div>
                    </td>
                </tr>
                    
                {{if gt .ListCount 0}}
                <tr style="padding:0px;margin:0px;">
                <td colspan="8" style="padding:0px;margin:0px;">

                    <table id="function-{{$v.Info.Id}}" class="table table-bordered table-hover collapse" style="margin-bottom: 0px;">
                        <thead>
                        <tr>
                            <th class="col-sm-1">子序号</th>
                            <th class="col-sm-2">功能名称</th>
                            <th class="col-sm-1">菜单显示</th>
                            <th class="col-sm-1">链接地址</th>
                            <th class="col-sm-1">隶属</th>
                            <th class="col-sm-1">状态</th>
                            <th class="col-sm-1">排序</th>
                            <th class="col-sm-3">操作</th>
                        </tr>
                        </thead>
                        {{range $kc, $vc := $v.List}}
                        <tr>
                            <th>{{.Id}}</th>
                            <td>
                                <i class="glyphicon glyphicon-play-circle"></i>—{{.Name}}
                            </td>
                            <td>
                                {{if eq 1 .IsMenu}}
                                <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/setmenu?id={{.Id}}')">
                                    <span title="点击取消菜单显示" class="badge badge-warning">是</span>
                                </a>
                                {{else}}
                                <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/setmenu?id={{.Id}}')">
                                    <span class="badge" title="点击设置菜单显示">否</span>
                                </a>
                                {{end}}
                            </td>
                            <td>/{{.Controller}}/{{.Action}}</td>
                            <td>隶属菜单：{{$v.Info.Name}}</td>
                            <td>{{if eq 1 .Status}}
                                <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/lock?id={{.Id}}')">
                                    <span title="点击锁定" class="badge badge-warning">正常</span>
                                </a>
                                {{else}}
                                <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/lock?id={{.Id}}')">
                                    <span title="点击解锁" class="badge">锁定</span>
                                </a> 
                                {{end}}
                            </td>
                            <td>{{$vc.Sort}}</td>
                            <td>
                                <div class="action-buttons">
                                <a class="blue" title="功能编辑" href="/{{adminPath}}/{{$.curController}}/add?id={{.Id}}">
                                    <i class="fa fa-pencil bigger-130"></i>
                                </a>

                                <a class="blue" title="删除" href="javascript:req('/{{adminPath}}/{{$.curController}}/del?id={{.Id}}')">
                                    <i class="fa fa-trash-o bigger-130"></i>
                                </a>
                                <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/sort?type=up&id={{.Id}}')">
                                    <i class="ace-icon glyphicon glyphicon-upload" title="排序上升"></i>
                                </a>

                                <a class="blue" href="javascript:req('/{{adminPath}}/{{$.curController}}/sort?type=down&id={{.Id}}')">
                                    <i class="ace-icon glyphicon glyphicon-download" title="排序下降"></i>
                                </a>
                                </div>
                            </td>
                        </tr>
                        {{end}}
                        <tbody>
                        </tbody>
                    </table>
                </td>
                </tr>
                {{end}}
                {{end}}
                </tbody>
            </table>
        </div>
    </div>
</div>

{{/* 
<div class="row">
    <div class="col-xs-12">
        <div class="dataTables_paginate paging_bootstrap">{{$pageLink}}</div>
    </div>
</div>
*/}}

<script>
    // jQuery(function($) {
    //     $('.glyphicon.glyphicon-plus').each(function(){
    //         $(this).on('click', function(){
    //             $(this).toggleClass('glyphicon-minus');
    //         });
    //     });
    // })
</script>
